package jmine.tec.aom.domain;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;

import jmine.tec.persist.annotation.Alias;
import jmine.tec.persist.annotation.UniqueConstraint;

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;
import org.hibernate.validator.NotNull;

import bancosys.tec.component.Documentation;
import bancosys.tec.persist.bussobj.PersistableBusinessObject;
import bancosys.tec.persist.persister.annotation.NaturalKey;
import bancosys.tec.persist.persister.annotation.SystemId;

/**
 * Defines a logical group of {@link Property}.
 * 
 * @author jrenaut
 */
@Entity
@Alias("GRPCAR")
@Table(name = "GRUPO_CARACTERISTICA")
@Documentation("ARMAZENA OS GRUPOS DE CARACTERISTICAS")
@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)
@SequenceGenerator(name = "SEQ_GRPCAR", sequenceName = "SEQ_GRPCAR")
public class PropertyGroup extends PersistableBusinessObject {

    private Long id;

    private String mnemonic;

    /**
     * @return the id
     */
    @Id
    @SystemId
    @Column(name = "COD_GRUPO_CARACTERISTICA")
    @Documentation("CODIGO DO GRUPO DE CARACTERISTICA")
    @GeneratedValue(strategy = GenerationType.AUTO, generator = "SEQ_GRPCAR")
    public Long getId() {
        return this.id;
    }

    /**
     * @return the mnemonico
     */
    @NotNull
    @NaturalKey
    @UniqueConstraint(name = "AK_GRPCAR_0")
    @Column(name = "MNE_GRP_CARAC", nullable = false)
    @Documentation("MNEMONICO DO GRUPO DE CARACTERISTICA")
    public String getMnemonic() {
        return this.mnemonic;
    }

    /**
     * @param id the id to set
     */
    public void setId(Long id) {
        this.id = id;
    }

    /**
     * @param mnemonico the mnemonico to set
     */
    public void setMnemonic(String mnemonico) {
        this.mnemonic = mnemonico;
    }

}
